package com.eloo.otsclient.util;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.eloo.otsclient.core.OTSConstants;

public class OTSStationInfo {
	protected static Log logger= LogFactory.getLog(Thread.currentThread().getClass());
	public static String[] stationInfo= null;
	public static volatile  HashMap<String, String> station = null;
	
	
	
	public static String getStatinInfo(String oraStation){  
		
		if (station == null || station.size() == 0) {
			synchronized (OTSStationInfo.class) { 
				//FileUtil.readFile(classloader.getResourceAsStream("tickposition.txt"))
	 
				//	stationInfo = new String(OTSConstants.STATION.getBytes("UTF-8"),"UTF-8").replaceAll("\\s", "").toString().split("\\|"); 

				station=new HashMap<String, String>();
				String[] city = OTSConstants.STATION.split("@");
			    for (String tmp : city) {
			      if (tmp.isEmpty())
			        continue;
			      String[] temp = tmp.split("\\|");
			      station.put(temp[1], temp[2]);
			    }
		 
			 
			 
			}
		}
		
		return station.get(oraStation); 
	}
	
	public static void main( String[] ags){
		
		
		System.out.println(getStatinInfo("株洲"));
	}
	 
} 
